package com.lihui.binarysearchtree;

import com.lihui.binarysearchtree.BinarySearchTree;

/**
 * 功能描述
 *
 * @author wileda
 * @date 2022/11/14  20:35
 */
public class Demo01 {
    public static void main(String[] args) {
        int[] array = {1,4,7,2,6,8,3,5,9};
        BinarySearchTree tree = new BinarySearchTree();
        for (int i = 0; i < array.length; i++) {
            tree.insert(array[i]);
        }
        System.out.println(tree.inorder(tree.root));

        System.out.println(tree.remove(7));
        System.out.println(tree.inorder(tree.root));
    }
}
